//
//  NetDataSource.h
//  Weikan
//
//  Created by maming on 11-8-10.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "BaseDataSource.h"
#import "ASIHTTPRequest.h"
#import "ASIFormDataRequest.h"

#define HTTP_POST_TIMEOUT 30

#define LOGININFO         @"login"
#define PERSONINFO        @"personinfo"
#define SIGNUP            @"signup"
#define FINDOUT           @"findout"
#define RECOMMENDINFO     @"recommend"
#define CREATTRIP         @"creattrip"
#define CITYLIST          @"citylist"
#define ELEMENTSEARCH     @"elementsearch"
#define TRAVELDETAIL      @"traveldetail"
#define CREATCOMMENT      @"creatcomment"
#define MYTRIP            @"mytrip"
#define COLLECTTRIP       @"collecttrip"
#define MYCOMMENT         @"mycomment"
#define FEEDBACK          @"feedback"
#define SECRETMODIFY      @"secretmodify"
#define SHOPDETAIL        @"shopdetail"
#define PERSONIMAGE       @"personimage"
#define CREATEVENTLIST    @"createventlist"
#define DELTRAVELLINE     @"deltravelline"
#define PRAISETRAVEL      @"praisetravel"
#define FAVORTRAVEL       @"favortravel"
#define COMMENTTRAVEL     @"commenttravel"
#define COMMENTLIST       @"commentlist"
#define UPDATEPERSONINFO  @"updatepersoninfo"
#define TRAVELEDITLINE    @"traveleditline"
#define DELEDITEVENTLIST  @"delediteventlist"
#define RECOMMENDMAPEVENT @"recommend_map_event"

@protocol DataSourceDelegate < NSObject >
- (void)onDataSourceSucCallback:(CoreMsg *)coreMsg withData:(id)data;
- (void)onDataSourceFailCallback:(CoreMsg *)coreMsg withData:(id)data;
@end

@interface NetDataSource : BaseDataSource <ASIHTTPRequestDelegate>
{

}

+ (NetDataSource*)shareInstance;

- (void)postTo:(NSString*)url postInfo:(NSDictionary*)info userInfo:(CoreMsg*)msg;
- (void)postFileTo:(NSString*)url postInfo:(NSString*)path userInfo:(CoreMsg*)msg;
- (void)getFrom:(NSString*)url getInfo:(NSDictionary*)info userInfo:(CoreMsg*)msg;
@end
